#define _CRT_SECURE_NO_WARNINGS 1

#include <stdio.h>

void Fun(int* left, int* right)
{
	while (left < right)
	{
		while (left < right &&*left % 2 != 0)
		{
			left++;
		}

		while (left < right &&*right % 2 == 0)
		{
			right--;
		}

		int tmp = *left;
		*left = *right;
		*right = tmp;
	}
}

int main()
{
	int arr[] = { 1,2,3,4,5,6,7,8,9 };
	int len = sizeof(arr) / sizeof(arr[0]);
	Fun(arr, arr + len - 1);
	for (int i = 0; i < len; i++)
	{
		printf("%d ", arr[i]);
	}
	return 0;
}